package com.it.sun.yuebike.base.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.it.sun.yuebike.base.mapper.InvitationMapper;
import com.it.sun.yuebike.base.model.dto.BikeInvitationDTO;
import com.it.sun.yuebike.base.model.entity.InvitationEntity;
import com.it.sun.yuebike.base.service.InvitationService;
import com.it.sun.yuebike.framework.model.dto.Result;
import com.it.sun.yuebike.framework.util.ResultUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author sunmannian
 * @since 2021-06-05
 */
@Service
public class InvitationServiceImpl extends ServiceImpl<InvitationMapper, InvitationEntity> implements InvitationService {

    @Override
    public Result<IPage<BikeInvitationDTO>> pageBikeInvitation(Page page) {
        IPage<BikeInvitationDTO> result = this.baseMapper.queryPage(page);
        return ResultUtils.success(result);
    }

    @Override
    public Result<BikeInvitationDTO> selectById(String id) {
        BikeInvitationDTO result = this.baseMapper.getOneById(id);
        return ResultUtils.success(result);
    }
}
